public class LotteryArray {

  public static void main(String[] args) {

    final int NMAX = 10;

    // Allocate triangular array.
    int[][] odds = new int[NMAX + 1][];
    for (int i = 0; i <= NMAX; i++)
      odds[i] = new int[i + 1];

    // Fill triangular array.
    for (int i = 0; i < odds.length; i++) {
      for (int j = 0; j < odds[i].length; j++) {
        int lotteryOdds = 1;
        for (int k = 1; k <= j; k++)
          lotteryOdds *= (i - k + 1) / k;
        odds[i][j] = lotteryOdds;
      }
    }

    // Print triangular array.
    for (int[] row : odds) {
      for (int odd : row)
        System.out.printf("%4d", odd);
      System.out.println();
    }
  }

}
